home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Mathematics / Notebooks / SigProc2.0 / Packages / SignalProcessing / Digital.m < prev    next >
Encoding:
Text File  |  1992-08-18  |  5.3 KB  |  190 lines

  1. (*  :Title:    Initialization for Digital Signal Processing Package  *)
  2.  
  3. (*  :Authors:    Brian Evans, James McClellan  *)
  4.  
  5. (*  :Summary:    This is an initialization file only  *)
  6.  
  7. (*  :Context:    Global`  *)
  8.  
  9. (*  :PackageVersion:  2.74    *)
  10.  
  11. (*
  12.     :Copyright:    Copyright 1989-1992 by Brian L. Evans
  13.         Georgia Tech Research Corporation
  14.  
  15.     Permission to use, copy, modify, and distribute this software
  16.     and its documentation for any purpose and without fee is
  17.     hereby granted, provided that the above copyright notice
  18.     appear in all copies and that both that copyright notice and
  19.     this permission notice appear in supporting documentation,
  20.     and that the name of Georgia Tech or Georgia Institute of
  21.     Technology not be used in advertising or publicity pertaining
  22.     to distribution of the software without specific, written prior
  23.     permission.  Georgia Tech makes no representations about the
  24.     suitability of this software for any purpose.  It is provided
  25.     "as is" without express or implied warranty.
  26.  *)
  27.  
  28. (*  :History:    *)
  29.  
  30. (*  :Keywords:    *)
  31.  
  32. (*  :Source:    *)
  33.  
  34. (*  :Warning:    *)
  35.  
  36. (*  :Mathematica Version:  1.2 or 2.0  *)
  37.  
  38. (*  :Limitation:  *)
  39.  
  40. (*
  41.     :Discussion:    Hierarchy of digital signal processing packages:
  42.  
  43.                     |
  44.              ---------------+---------------
  45.             |        |        |
  46. (d)    DSPAnalyze.m   DFT.m        |        |         D
  47.         |        |        |        |         I
  48.          -----------+        |        |         G
  49.             |        |        |         I
  50. (c)              DTFT.m       ZSolve.m    Correlation.m         T
  51.             |        |        |         A
  52.          -----------+     -------+---------------+---         L
  53.         |        |    |                |
  54. (b)        |          ZTransform.m             InvZTransform.m
  55.         |            |                |
  56.         |                 ----------------------
  57.         |                       |
  58. (a)    DSupport.m               ZSupport.m
  59.         |                       |
  60.          ----------------------------------
  61.                   |
  62.               (Support Packages)
  63.  *)
  64.  
  65.  
  66. (*  B E G I N     I N I T I A L I Z A T I O N  *)
  67.  
  68.  
  69. (*  Load in the packages on which the DSP packages rely  *)
  70.  
  71. Needs[ "SignalProcessing`Support`" ]
  72.  
  73.  
  74. Which [
  75.  
  76.  
  77. (*  Check to see if this has already been loaded  *)
  78.  
  79. MemberQ[ $ContextPath, "SignalProcessing`Digital`" ],
  80.  
  81.   digital::loaded =
  82.       "Version 2.74 of the digital signal processing packages has \
  83.         already been loaded.",
  84.  
  85.  
  86. (*  For Mathematica 2.0, we only define the stubs  *)
  87.  
  88. TrueQ[ $VersionNumber >= 2.0 ],
  89.  
  90.   Print["Defining stubs for the objects in version 2.74 of the \
  91.         digital signal processing packages ..."];
  92.  
  93.   DeclarePackage[ "SignalProcessing`Digital`Correlation`", { 
  94.             "CorrelationSequence" } ];
  95.  
  96.   DeclarePackage[ "SignalProcessing`Digital`DFT`", { 
  97.             "DFTData", "DFTransform", "Finish",
  98.             "InvDFTransform", "KVariables", "Start" } ];
  99.  
  100.   DeclarePackage[ "SignalProcessing`Digital`DSPAnalyze`", { "DSPAnalyze" } ];
  101.  
  102.   DeclarePackage[ "SignalProcessing`Digital`DSupport`", { 
  103.             "FourierSimplify", "FVariables" } ];
  104.  
  105.   DeclarePackage[ "SignalProcessing`Digital`DTFT`", {
  106.             "DTFTData", "DTFTransform", "InvDTFTransform" } ];
  107.  
  108.   DeclarePackage[ "SignalProcessing`Digital`InvZTransform`", { 
  109.             "InvZTransform" } ];
  110.  
  111.   DeclarePackage[ "SignalProcessing`Digital`ZMath`", { 
  112.             "AddROCInformation", "ZCombineROC", "ZInvert" } ];
  113.  
  114.   DeclarePackage[ "SignalProcessing`Digital`ZSolve`", { 
  115.             "RightSided", "ZSolve" } ];
  116.  
  117.   DeclarePackage[ "SignalProcessing`Digital`ZSupport`", { 
  118.             "InvalidZTransformQ", "InvalidInvZTransformQ",
  119.             "KeepNormalized", "MakeZObject", "ZForm",
  120.             "ZTransformQ", "ZUpsampledQ" } ];
  121.  
  122.   DeclarePackage[ "SignalProcessing`Digital`ZTransform`", { 
  123.             "ZTransform" } ];
  124.  
  125.   AppendTo[ $ContextPath, "SignalProcessing`Digital`" ];
  126.  
  127.   digital::loaded =
  128.     "Stubs for the routines, objects, and rules for the digital signal \
  129.     processing packages have been loaded successfully.",
  130.  
  131.  
  132. (*  Load them in manually under Mathematica 1.2  *)
  133.  
  134. True, 
  135.  
  136.   Print["Loading version 2.74 of the digital signal processing packages ..."];
  137.  
  138.   Needs[ "SignalProcessing`Digital`ZSupport`" ];        (* level a *)
  139.   Needs[ "SignalProcessing`Digital`DSupport`" ];
  140.  
  141.   Needs[ "SignalProcessing`Digital`ZTransform`" ];        (* level b *)
  142.   Needs[ "SignalProcessing`Digital`InvZTransform`" ];
  143.  
  144.   Needs[ "SignalProcessing`Digital`DTFT`" ];            (* level c *)
  145.   Needs[ "SignalProcessing`Digital`Correlation`" ];
  146.   Needs[ "SignalProcessing`Digital`ZSolve`" ];
  147.  
  148.   Needs[ "SignalProcessing`Digital`DSPAnalyze`" ];        (* level d *)
  149.   Needs[ "SignalProcessing`Digital`DFT`" ];
  150.  
  151.   AppendTo[$ContextPath, "SignalProcessing`Digital`"];
  152.  
  153.   digital::loaded =
  154.     "Routines, objects, and rules for the digital signal \
  155.     processing packages have been loaded successfully."
  156. ]
  157.  
  158.  
  159. (*  Temporary messages  *)
  160.  
  161. digital::error = "The current context should be Global` and it is not."
  162.  
  163. (*  Error checking  *)
  164.  
  165. If [ SameQ[$Context, "Global`"],
  166.      Message[ digital::loaded ],
  167.      Message[ digital::error ] ]
  168.  
  169. (*  Remove temporary messages  *)
  170.  
  171. digital::error = .
  172. digital::loaded = .
  173.  
  174.  
  175. (*  Inform the user about the digital signal processing packages  *)
  176.  
  177. Print[ " " ]
  178. Print[ "Digital signal processing extensions have been defined." ]
  179. Print[ "Good starting points are the objects DSPAnalyze and ZTransform." ]
  180. Print[ "Active packages are maintained in $ContextPath." ]
  181. Print["  Evaluate SPsignals for a list of all new signals (functions)." ]
  182. Print["  Evaluate SPoperators for a list of all new operators (systems)." ]
  183. Print["  Evaluate SPfunctions for a list of all new routines." ]
  184. Print[ "Use SPSimplify to simplify signal processing expressions."]
  185. Print[ " " ]
  186.  
  187. (*  E N D     I N I T I A L I Z A T I O N  *)
  188.  
  189. Null
  190.